# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Spanner.V1.Model.AutoscalingLimits do
  @moduledoc """
  The autoscaling limits for the instance. Users can define the minimum and maximum compute capacity allocated to the instance, and the autoscaler will only scale within that range. Users can either use nodes or processing units to specify the limits, but should use the same unit to set both the min_limit and max_limit.

  ## Attributes

  *   `maxNodes` (*type:* `integer()`, *default:* `nil`) - Maximum number of nodes allocated to the instance. If set, this number should be greater than or equal to min_nodes.
  *   `maxProcessingUnits` (*type:* `integer()`, *default:* `nil`) - Maximum number of processing units allocated to the instance. If set, this number should be multiples of 1000 and be greater than or equal to min_processing_units.
  *   `minNodes` (*type:* `integer()`, *default:* `nil`) - Minimum number of nodes allocated to the instance. If set, this number should be greater than or equal to 1.
  *   `minProcessingUnits` (*type:* `integer()`, *default:* `nil`) - Minimum number of processing units allocated to the instance. If set, this number should be multiples of 1000.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :maxNodes => integer() | nil,
          :maxProcessingUnits => integer() | nil,
          :minNodes => integer() | nil,
          :minProcessingUnits => integer() | nil
        }

  field(:maxNodes)
  field(:maxProcessingUnits)
  field(:minNodes)
  field(:minProcessingUnits)
end

defimpl Poison.Decoder, for: GoogleApi.Spanner.V1.Model.AutoscalingLimits do
  def decode(value, options) do
    GoogleApi.Spanner.V1.Model.AutoscalingLimits.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Spanner.V1.Model.AutoscalingLimits do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
